import java.util.Arrays;

/**
 * @author mazouri
 * @create 2022-01-13 12:05
 */
public class CombineMemo {
    long count = 0;
    long[][] memo;

    public CombineMemo(int m, int n) {
        this.memo = new long[m + 1][n + 1];
        for (long[] longs : memo) {
            Arrays.fill(longs, -1);
        }
        System.out.println(C(m, n));
    }

    public long C(int m, int n) {
        if (m == n - 1) return 0;
        if (n == 0) return 1;


        if (memo[m][n] < 0) {
            count++;
            memo[m][n] = C(m - 1, n - 1) + C(m - 1, n);
        }

        return memo[m][n];
    }

    public static void main(String[] args) {
        CombineMemo combineMemo = new CombineMemo(100,50);
        System.out.println(combineMemo.count);
    }
}
